package com.xingzhe.pengji.security.controller.ajax;

import org.directwebremoting.annotations.Param;
import org.directwebremoting.annotations.RemoteMethod;
import org.directwebremoting.annotations.RemoteProxy;
import org.directwebremoting.spring.SpringCreator;
import org.springframework.beans.factory.annotation.Autowired;

import com.xingzhe.pengji.security.domain.User;
import com.xingzhe.pengji.security.services.UserService;

/**
 * @Title ： 三江学院 毕业设计
 * @Description ： UserControlAjax 异步加载
 * @author ：LuFengLiang
 * @Company: IT行者工作室
 * @Copyright: Copyright (c) 2012-3-3
 * @version ： 1.0
 */
@RemoteProxy(creator=SpringCreator.class,creatorParams = @Param(name = "beanName", value = "userConAjax"))
public class UserControllerAjax<T extends User>
{   
    @Autowired
    private UserService<T> userService;
    
    /**
     * 判断邮箱是否被注册
     * @param email
     * @return
     */
	@RemoteMethod
    public String judjeEmialExit(String email)
    {
        @SuppressWarnings("unchecked")
		T entity=(T) new User();
        entity.setEmail(email);
        if(null==userService.judgeEmialExit(entity))
            return "true";
        return "false";
    }
    
}
